home *** CD-ROM | disk | FTP | other *** search
- Path: news.bright.net!news
- From: e <drtypair@bright.net>
- Newsgroups: comp.lang.c++
- Subject: C++ input question
- Date: 29 Mar 1996 04:32:48 GMT
- Organization: BrightNet Ohio
- Message-ID: <4jfp5g$7tc@cletus.bright.net>
- NNTP-Posting-Host: akro1-cs-3.dial.bright.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; I; 16bit)
-
- ok I'm not really sure what you guys handle on thie newsgroup but I'm
- grasping at staws
-
- I have exactly 30 minutes(it's going to be late) to turn in a program for
- my data structures and algorithms I course( yes I am a baby to this)
-
- here's my problem:
-
- I have an input structure:
-
- int itemp,ptemp;
- while(cin.peek()!=EOF){ //I know this is wrong, peek returns an int
- cin>>itemp;
- cin.ignore (3);
- cin>>ptemp;
- reg[r][ptemp]=itemp;
- }
-
- that has to input a preset input structure:
-
- <register><space><polynomial>
- ex.
- 2 3 x^4+1 x^3+5 x^0+12 x^1
-
- the problem:
- is there a way to determine where the end of an input in(i.e. how do I
- know I hit the ....^1(carriage return) )????
-
- I know there must be a way to find the end, and I NEED it or else my
- loop never ever ends
-
-
- Now if the answer is simple, keep two things in mind:
- 1) this is only my second semester of c++
-
- 2) I am currently going crazy becuase of this program(well I do for all
- of them as a matter of fact)
-
- If anyone has any solution or even the slightest push in the right
- direction, AND has it by 3/29/96, Friday, tomorrow
- please mail me:
-
- send enlightenment to:
- r3egk@vm1.cc.uakron.edu
- AND (if not to much of a bother)
- aa746@freenet.akron.oh.us
-
- thanx in advance for anything I get.....................I need COFFEE!!
-
-
-
- p.s. I want to see if anyone else out there gets this
-
- (for those of us still in school)
- The answer for all unaswerable computer science lab questions:
- this is a square O.
- --Chico
- I can't explain it, but it seems to make some sense...or am I just crazy
-
-